<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/style.css" />
<!--/meta 作为公共模版分离出去-->
<title>发行对象</title>
</head>
<body ng-controller="main">
<article class="page-container">
	<form action="<?php url('voucher/issue')?>" method="post" class="form form-horizontal" id="form-add">
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2"><span class="c-red">*</span>发送对象：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="radio" class="radio-box" id="user-all" value="0" name="where" checked/><label for="user-all" style="padding-right:10px;"> 所有用户 </label>
				<input type="radio" class="radio-box" id="user-some" value="1" name="where" /><label for="user-some" style="padding-right:10px;"> 指定条件</label>
				<input type="radio" class="radio-box" id="user-one" value="2" name="where" /><label for="user-one" style="padding-right:10px;"> 指定个人</label>
				<input type="radio" class="radio-box" id="user-business" value="3" name="where" /><label for="user-business"> 指定商家</label>
			</div>
		</div>
        <div class="row cl" id="recharge1" hidden>
            <label class="form-label col-xs-3 col-sm-2"><span class="c-red">*</span>充值金额：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="number" class="input-text" value="" placeholder="请输入充值范围" id="recharge_begin" name="recharge_begin" style="width: 150px"> -
                <input type="number" class="input-text" value="" placeholder="请输入充值范围" id="recharge_end" name="recharge_end" style="width: 150px">
            </div>
        </div>
        <div class="row cl" id="recharge2" hidden>
            <label class="form-label col-xs-3 col-sm-2"><span class="c-red">*</span>用户ID：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="number" class="input-text" value="" placeholder="请输入用户ID" id="uid" name="uid" style="width: 100%">
            </div>
        </div>
        <div class="row cl" id="recharge3" hidden>
            <label class="form-label col-xs-3 col-sm-2"><span class="c-red">*</span>商家(商家粉丝)：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <?php foreach($list as $v){?>
                    <input type="checkbox" value="<?php echo $v['id']?>" name="business_id[]" id="business_id" class="ml-5"/><?php echo $v['name'];}?>
            </div>
        </div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-10 col-xs-offset-3">
                <input type="hidden" name="id" value="<?php echo $info['id']?>" />
				<input class="btn btn-primary radius" id="btn" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/layer.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="/static/admin/js/validate-methods.js"></script>
<script type="text/javascript" src="/static/admin/js/messages_zh.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
$(function(){
    $("input[name='where']").click(function () {
        var where = $("input[name='where']:checked").val();
        if(where == 0){
            $('#recharge1,#recharge2,#recharge3').hide();
        }
        if(where == 1){
            $('#recharge1').show();
            $('#recharge2,#recharge3').hide();
        }
        if(where == 2){
            $('#recharge2').show();
            $('#recharge1,#recharge3').hide();
        }
        if(where == 3){
            $('#recharge3').show();
            $('#recharge1,#recharge2').hide();
        }
    });
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#form-add").validate({
		rules:{

		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			var options = {
				success: function (data) {
					if(data.code == 0){
						layer.msg(data.msg,{icon:1,time:1000});
						setInterval("closeWindow()",1000);
					}else{
						layer.msg(data.msg,{icon:5,time:1000});
					}
				}
			};
			$(form).ajaxSubmit(options);
		}
	});
});
function closeWindow() {
	var index = parent.layer.getFrameIndex(window.name);
	window.parent.location.reload();
}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>